home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d3
/
amac36.arc
/
TOGL12.QM
< prev
next >
Wrap
Text File
|
1991-03-16
|
9KB
|
241 lines
* TOGL12.QM
* Toggle Insert, AutoIndent and Backups Macros, v1.2
*
* Macro --- Toggle --- (1) Bytes Keeps cursor position ?
* @5 Backups Off TH 50 Yes <- new
* @6 Insert Off TF 21 Yes
* @7 Insert On TF 21 Yes
* @8 Insert On KW 26 No, moves right
* @9 Insert On TH 16 No, moves right
* @0 AutoIndent On TH 46 No, begline
*
* (1) Authors: TH-Tom Hoghsead
* KW-Kyle Watkins
* TF-Tim Farley
* Version History:
* 1.0 Initial version, Alt9 & 0
* 1.1 Alt_6,7 & 8 added
* 1.1a Changed file name TOGGLE11 to TOGL11.
* 1.1b Modified this file documentation.
* 1.1c Modified this file documentation and added START.BAT.
* Changed TOGGLE file names to TOGL.
* 1.2 Added @5 toggle Backups OFF.
* For other macros, see ALLMACRO.INF.
* These macros require "QEdit and QMAC v2.1, February, 1990" or later.
*
* To BEGIN, just type "START TOGL" <Enter>. All pertinent files will be
* loaded in the "Ring" for viewing, and TOGL12.MAC is read.
* Alternatively, type "START TOGL 0" <Enter> and the disk copies of all
* files in the "Ring" will be loaded ready for editing, saving time.
*--------------------------------
* @5 Toggle backups OFF if ON
*--------------------------------
* Change "c:" to ramdrive for faster operation.
*
@5 MacroBegin *
EditFile "c:!" Return * Edit temp file
BegFile * TOF if temp file is loaded
MarkBlockBegin EndFile MarkBlockEnd * Mark file to delete all of it
DeleteBlock Insertline * Delete it! Make 2 line file
SaveFile SaveFile * Save twice to make backup if
* backups toggled ON
Killfile Quit * Kill/quit c:!
EditFile "c:!.bak" Return * Load c:!.bak
Newfile Return * Exit and Edit c:!.bak
Gotoline "2" Return * Try to go to line 2
jfalse BAKOFF: * If line 2 not found, backups was OFF
* Test is false, go to BAKOFF
* ELSE backups was ON,
Togglebakups * and toggle backups OFF
BAKOFF: *
Killfile Quit * Kill/quit c:!.bak
*
* 50 bytes Tue 02-12-1991 12:14:46
*--------------------------------
* @6 Toggle INSERT OFF
*--------------------------------
*
@6 macrobegin
insertline * insert test line
"a" cursorleft "a" *
endline * if not at endline-insert is on
jtrue WASON: * if at endline -insert is off
Jump WASOFF:
WASON:
toggleinsert * toggle it off
cursorleft * clean up cursor movement
WASOFF:
cursorleft * clean up cursor movement
delline * delete test line
*
* 21 bytes Mon 07-30-1990 19:16:01
*--------------------------------
* @7 Toggle INSERT ON
*--------------------------------
*
@7 macrobegin
insertline * insert test line
"a" cursorleft "a" *
endline * if not at endline-insert is on
jtrue WASON: * if at endline -insert is off
toggleinsert * toggle on it on
Jump WASOFF: * and exit.
WASON:
cursorleft * clean up cursor movement
WASOFF:
cursorleft * clean up cursor movement
delline * delete test line
*
* 21 bytes Mon 07-30-1990 19:15:36
*--------------------
* @8 Toggle Insert ON
*--------------------
* Here's an alternate but slightly longer version written by Kyle
* Watkins of SemWare
*
@8 Macrobegin
Insertline
"x"
TESTINSERT:
Insertline
Cursorleft "a" Cursorleft "a"
Endline
Jtrue END:
Toggleinsert
END:
Delline
Endline
Delline
*
* 26 bytes Fri 07-27-1990 22:44:48
* Replace jtrue in Alt_9 line 3 and Alt_8 line 8 with jfalse
* to toggle off.
* To: TOM HOGSHEAD Refer#: 9159
* From: KYLE WATKINS Read: 07-30-90 (18:35)
* Subj: POSSIBLE QEDIT CHANGES Status: PUBLIC MESSAGE
* Conf: MAIN board (0) Read Type: GENERAL (A)
*
* Hi Tom,
* The macro has some steps in it which seem unneccesary -- but it takes
* care of the case of being in column 1 or column 512 AND it will
* preserve the original cursor location (since it is taking care of all
* possibilities, it does get involved -- but in most cases, as in yours,
* It can be cut back a few bytes.)
* Also -- many thanks for the assorted macros you have written -- many
* users will find them very useful.
* --... ...--
* .......Kyle Watkins (SemWare Technical Support)
*
* (H)elp, End of Message Command?
*
* Date: 07-30-90 (17:34) Number: 9191 / 9206
* To: TOM HOGSHEAD Refer#: 9159
* From: TIM FARLEY Read: NO
* Subj: POSSIBLE QEDIT CHANGES Status: PUBLIC MESSAGE
* Conf: MAIN board (0) Read Type: GENERAL (A)
*
* TH>@0 macrobegin
* TH> insertline * insert test line
* TH> "a" cursorleft "a" *
* TH> endline * if not at endline-insert is on
* TH> jtrue END: * if at endline -insert is off
* TH> toggleinsert * toggle on if off
* TH> END: *
* TH> delline * delete test line
*
* Neat macro, Tom! However, it does have a slight side effect of
* moving the current cursor position to the right. Here are
* versions that make sure to undo that.
*---------------------
* @9 toggles Insert ON
*---------------------
*
@9 macrobegin
insertline * insert test line
"a" cursorleft "a" * insert "aa"
endline * if not at endline-insert is on
jtrue END: * if at endline -insert is off
toggleinsert * toggle on if off
END: *
delline * delete test line
*
* 16 bytes Fri 07-27-1990 22:44:42
*-------------------------
* @0 Toggle AutoIndent ON
*-------------------------
*
* Alt_0 is a macro to toggle AutoIndent ON if OFF. I don't have any use
* for it but maybe somebody does - I leave AutoIndent ON all the time.
* Alt_9, a macro to toggle Insert ON if OFF, prompted me to see if
* AutoIndent could also be toggled ON if OFF. No effort was spent
* optimizing Alt_0. Somebody may want to try that. If anybody can use
* it, use and enjoy. There no tricks here, just taking advantage of
* jtrue. By the way, AutoIndent can be toggled OFF if ON by replacing
* jtrue with jfalse. Don't run with cursor line in macro below or the
* ■'s in the comments will be found and things get messed up.
*
@0 macrobegin
setrmargin "3" return * set line 3 chars
insertline * insertblank line for bot para
begline * go to begin of line
cursorright * insert space
insertline * insert 2nd blank line
#254 * insert ■ on line in column 2
insertline * insert 3rd blank line
begline * go to begin of line
#254 #254 * insert ■■ in column 1 & 2
insertline * insert blank line for top para
wrappara * format paragraph
setrmargin "80" return * reset right margin
cursorup * get cursor line on bot para
begline * go to begline
find #254 return return * try to find ■
jtrue INDENTON: * if ■ in column 1, can't find
toggleindent * toggle AutoIndent ON
INDENTON: * begin clean up
delline * delete line ■
cursorup * cursor up to line ■■
delline * delete line ■■
cursorup * cursor up to blank line
delline * delete blank line
delline * delete blank line
scrollup * reallign screen
*
* 46 bytes Sat 07-28-1990 18:33:31
* 1
* 2
* 3 try Alt_0 here not above
* 4
* 5
* 6
*...Tom Hogshead Tue 02-12-1991